<template>
	<div> 
		<div class="container">
			<TableCustom :columns="columns" :tableData="tableData" :total="tableData.length" :page-size="100000" >
			</TableCustom>

		</div>


	</div>
</template>

<script setup lang="ts" name="basetable">
import { ref, reactive } from 'vue';
import { ElMessage, } from 'element-plus';
import { CirclePlusFilled } from '@element-plus/icons-vue';
import { fetchData,fetchTeacherData,insertTeacherData,deleteTeacherData,updateTeacherData,getAllColleges } from '@/api/index';
import TableCustom from '@/components/table-custom.vue';
import TableDetail from '@/components/table-detail.vue';
import TableSearch from '@/components/table-search.vue';
import { TableItem } from '@/types/table';
import { FormOption, FormOptionList } from '@/types/form-option';

const query = reactive({
	name: null,
	tid:null,
	college_id:null
});

const searchOpt = ref<FormOptionList[]>([
	{ type: 'input', label: '姓名：', prop: 'name' },
	{ type: 'number',label: '教师号', prop: 'tid'},
	{ type: 'number',label: '学院号', prop: 'college_id' }
])
const handleSearch = () => {
	changePage(1);
};

// 基本信息
const collegeInfo = [
    { prop: 'college_id', label: '学院号' },
	{ prop: 'name', label: '学院' },
	
]
let columns = ref([
	...collegeInfo,
])


const page = reactive({
	index: 1,
	size: 10000,
	total: 200,
})
const changePage = async (val: number) => {
	const res = await getAllColleges();
	tableData.value = res.data;
	page.index = val;
};



const tableData = ref<TableItem[]>([]);
const getData = async () => {
	changePage(1)
	
};
getData();


</script>

<style scoped>

</style>
